# 十进制： 1, 2, 10, 10000, 0, -1234

# 二进制： 0b开头，跟01
# print(0b101)    # 5

# 八进制： 0o开头，跟0-7
# print(0o10)

# 十六进制： 0x开头，跟0-9和a-f
# print(-0x0)


# 字符串索引、切片
# 索引用 [下标号]
txt = "张三是法外狂徒"  # 0张 1三 2是 3法 4外 5狂 6徒
# -7张 -6三 -5是 -4法 -3外 -2狂 -1徒
# print(txt[0])
# print(txt[6])

# print(txt[-1])
# print(txt[-7])

# 切片用 [起始下标: 结束下标]
# print(txt[0:3])
# print(txt[-7:-4])

# 相加
# t1 = "张三"
# t2 = "是"
# t3 = "法外狂徒"

# print(t1 + t2 + t3)
# print(t1 * 3)   # 相乘

# 判断子字符串是否在主字符串内
# t_son = "张三"
# t_son2 = "李四"
# t_father = "张三是法外狂徒"
#
# print(t_son in t_father)
# print(t_son2 in t_father)

# 判断字符串长度
# print(len(txt))

# 字符串化，把其他数据类型变成字符串
# num = 3.1415926
# print(type(num))
#
# num = str(num)
# print(type(num))

# 获取字符的unicode编码 ord()
# print(ord("a"))
# print(ord("狂"))

# 获取unicode编码对应的字符 chr()
# print(chr(97))

# 生成随机10位密码
# import random
# password = ""
# for i in range(10):
#     chart = chr(random.randint(97, 97+25))
#     password += chart
#
# print("生成的10位小写字母的随机密码：", password)


# 拆分 split()
# txt = "张三 是 法外狂徒"
# print(txt.split(' '))
# for t in txt.split(' '):
#     print(t)

# 去掉首尾字符： strip()；去掉首字符 lstrip()； 去掉尾字符 rstrip()

# txt = "???张三???是???法外狂徒???"
# print(txt.strip("?"))
# print(txt.lstrip("?"))
# print(txt.rstrip("?"))

txt = "{1:4<6}是{0}"

# name = "张三"
# print(
#     txt.format(
#         name,
#         "法外狂徒"
#     )
# )
#
# name = "李四"
# print(
#     txt.format(
#         name,
#         "法外狂徒"
#     )
# )


# a = True
# b = False
#
# if a:
#     print("是True")

# name = "李四"
# lis = ['张三', 123, 3.14, name, True, False, None]
# lis = [5, 2, 6, 4, 1, 3]

# lis = []
# lis.sort()

# lis = list()

# print(lis, type(lis))

# lis.sort()
# lis = sorted(lis, reverse=True)
# print(lis)


# tul = (5, 3, 4, 8, 9)
# tul.sort()

# print(tul, type(tul))

# age = 18
#
# dic = {
#     "name": "李四",
#     "age": age
# }
#
# print(dic, type(dic))
#
# print(
#     dic.get("name")
# )
#
#
# dic["key1"] = "value1"
# dic["key1"] = "value2"
#
# print(dic)

# ls = [1,2,3,4,5,6,5,1,2,1,5,2,5,2,1]
# st = set(ls)
# st = set()
# print(st, type(st))


# lis = [5, 3, 4, 8, 9]
# lis.sort()
# print(lis)

# lis = sorted(lis, reverse=True)
# print(lis)

import math

print(math.sin(30))

print()
